package com.github.nacostwo.entity;

import java.io.Serializable;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@EqualsAndHashCode(callSuper = false)
@Document(indexName ="test_eb",createIndex = false)
public class EsBook implements Serializable {
    private static final long serialVersionUID = 5328169235387886752L;
    @Id
    private String id;
    @Field(store = true, name = "book_name", type = FieldType.Keyword)
    private String name;
    @Field(store = true, name = "book_desc", type = FieldType.Keyword)
    private String desc;
    @Field(store = true, type = FieldType.Integer)
    private Integer price;
}
